<template>
  <ul class="contact-container">
    <li>
      <a :href="data.weixinQrCode" target="_blank">
        <div class="contant-type">
          <div class="contact-icon weixin">
            <Icon type="weixin" />
          </div>
          <span class="contact-text">{{data.weixin}}</span>
        </div>
      </a>
      <div class="contact-show">
        <img
          :src="data.weixinQrCode"
        />
      </div>
    </li>
    <li>
      <a :href="`tencent://message/?Menu=yes&uin=${data.qq}&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45`">
        <div class="contant-type">
          <div class="contact-icon">
            <Icon type="qq" />
          </div>
          <span class="contact-text">{{data.qq}}</span>
        </div>
      </a>
    </li>
    <li>
      <a :href="`mailto:${data.mail}`">
        <div class="contant-type">
          <div class="contact-icon">
            <Icon type="mail" />
          </div>
          <span class="contact-text">{{data.mail}}</span>
        </div>
      </a>
    </li>
    <li>
      <a :href="data.gitee" target="_blank">
        <div class="contant-type">
          <div class="contact-icon">
            <Icon type="github" />
          </div>
          <span class="contact-text">{{data.githubName}}</span>
        </div>
      </a>
    </li>
  </ul>
</template>

<script>
import Icon from "@/components/Icon";
export default {
  components: {
    Icon,
  },
  computed:{
    data(){
      return this.$store.state.setting.data;
    }
  }
};
</script>

<style scoped lang='less'>
@import "~@/styles/var.less";

.contact-icon,
.contact-text {
  color: @lightWords;
  padding: 0px 6px;
  line-height: 36px;
}

.contact-container {
  .contact-icon{
    font-size: 20px;
  }
  .weixin{
    font-size: 23px;
    padding: 0px 4px;
  }
  li{
    position: relative;
    height: 36px;
    padding: 5px;
  }
  li:hover{
      .contact-show{
          opacity: 1;
           transform:translate(-50%, -100%) scaley(1);
      }
  }
  .contant-type {
    display: flex;
    padding-left: 15px;
  }
  .contact-show {
    opacity: 1;
    transition: 0.5s;
    position: absolute;
    padding: 5px;
    top: 0;
    left: 106px;
    transform: translate(-50%, -100%) scaley(0);
    transform-origin: center bottom;
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    &::after {
      content: "";
      position: absolute;
      width: 9px;
      height: 9px;
      background-color: white;
      left: 50%;
      bottom: 0;
      transform: translate(-50%, 50%) rotate(45deg);
    }

    img {
      width: 150px;
      height: 150px;
      object-fit: contain;
    }
  }
}
</style>